<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="../common.jsp"%>
<%@ page import="cn.firstsoft.firstframe.admin.PropertyFile"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<%
	String flag = request.getParameter("flag");
	String ret = "";
	if ("suc".equals(flag)) {
		ret = "设置成功,并请重新启动服务器！";
		
    }else if("fail".equals(flag)) {
    	ret = "设置保存失败！";
	}else{
		ret = "";
	}
%>
<c:set var="retValue" value="<%=ret%>" />

<%
String eas_webservice_requesturl = PropertyFile.readValue("firstframe.properties", "eas.webservice.requesturl")==null?"":PropertyFile.readValue("firstframe.properties", "eas.webservice.requesturl");
String eas_webservice_slnname = PropertyFile.readValue("firstframe.properties", "eas.webservice.slnname")==null?"":PropertyFile.readValue("firstframe.properties", "eas.webservice.slnname");
String eas_webservice_dcname = PropertyFile.readValue("firstframe.properties", "eas.webservice.dcname")==null?"":PropertyFile.readValue("firstframe.properties", "eas.webservice.dcname");
String message_eas_source = PropertyFile.readValue("firstframe.properties", "constant.message_eas_source")==null?"":PropertyFile.readValue("firstframe.properties", "constant.message_eas_source");
String eas_webservice_language = PropertyFile.readValue("firstframe.properties", "eas.webservice.language")==null?"L2":PropertyFile.readValue("firstframe.properties", "eas.webservice.language");
String integrationStyle = PropertyFile.readValue("firstframe.properties", "plugins.eas.integrationStyle");
if ( integrationStyle == null ) {
	integrationStyle = "2";
}

%>

<html>
	<head>
		<title>管理控制台 - 环境设置 - 系统集成设置</title>
		<%@ include file="/common/meta2.jsp"%>
		<link href="../style.css" type="text/css" rel="stylesheet">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	</head>
	<body>
		<form method="post" name="integrationForm"
			action="integration_setting_update.jsp">
			&nbsp;
			<input class="button" type="submit" value="提&nbsp;&nbsp;交" />
			<input class="button" type="reset" value="重&nbsp;&nbsp;置" />
			<c:if test="${not empty retValue }">
				<br>
				<c:out value="${retValue }" />
			</c:if>
			<table width="100%" align="center">
				<tr>
					<th class="listViewPaginationTdS1" align="left" colSpan="4">
						业务系统集成
					</th>
				</tr>
	    <tr>
			<TH align="right" width="20%">名&nbsp;&nbsp;称</TH>
			<TH align="left" width="30%">设置值</TH>
			<TH align="left" width="20%">默认值</TH>
			<TH align="left" width="30%">描&nbsp;&nbsp;述</TH>
		</tr>
		 <tr>
			<td  class=dataLabel align="right">
				系统集成：
			</td>
			<td  class=dataField align="left">
					<input type="radio" id="integrationNo" name="integration"  value="no" onclick="integrationChanage()" />
					不集成
					<input type="radio" id="integrationEas" name="integration" value="eas" onclick="integrationChanage()"/>
					集成EAS
					<input type="radio" id="integrationK3" name="integration" value="k3" onclick="integrationChanage()"/>
					集成K/3
			</td>
			<td align="left" style="word-break: break-all">
				不集成
			</td>
			<td  align="left">
				集成系统内容，包括：不集成、集成EAS、集成K/3,默认不集成
			</td>
			</tr>
				<tbody id="easIntegrationId"  style="display:none">
				<tr>
					<td  class=dataLabel align="right">
						EAS集成方式：
					</td>
					<td  class=dataField align="left">
						<select id="plugins_eas_integrationStyle" name="plugins_eas_integrationStyle">
						 <option value="1" <%="1".equals(integrationStyle)?"selected":"" %>>弹开式</option>
						 <option value="2" <%="2".equals(integrationStyle)?"selected":"" %>>嵌入式</option>
					   </select>
					</td>
					<td  align="left" style="word-break: break-all">
						&nbsp;
					</td>
					<td  align="left">
						&nbsp;
					</td>
				</tr>
				
				<tr>
					<td  class=dataLabel align="right">
						EAS WebService地址：
					</td>
					<td  class=dataField align="left">
					
					 <input type="text" size="40" name="eas_webservice_requesturl" value="<%=eas_webservice_requesturl%>"
					 
					</td>
					<td  align="left" style="word-break: break-all">
						http://127.0.0.1:6888/web/services/EASLogin
					</td>
					<td  align="left">
						EAS WebService地址。该属性只在集成EAS时有效
					</td>
				</tr>
				
				<tr>
					<td  class=dataLabel align="right">
						EAS解决方案名称：
					</td>
					<td  class=dataField align="left">
					 <input type="text" size="40" name="eas_webservice_slnname" value="<%= eas_webservice_slnname%>">
					</td>
					<td  align="left" style="word-break: break-all">
						eas
					</td>
					<td  align="left">
						EAS解决方案名称(通常为eas)。该属性只在集成EAS时有效
					</td>
				</tr>
				
					<tr>
					<td  class=dataLabel align="right">
						EAS数据中心代码：
					</td>
					<td  class=dataField align="left">
					 <input type="text" size="40" name="eas_webservice_dcname" value="<%=eas_webservice_dcname%>">
					</td>
					<td  align="left" style="word-break: break-all">
						&nbsp;
					</td>
					<td  align="left">
						EAS数据中心代码，可在EAS控制台中查看。该属性只在集成EAS时有效
					</td>
				</tr>
				
				<tr>
					<td  class=dataLabel align="right">
						EAS语言：
					</td>
					<td  class=dataField align="left">
					<select id="eas_webservice_language" name="eas_webservice_language">
					 <option value="L1" <%="L1".equals(PropertyFile.readValue("firstframe.properties", "eas.webservice.language"))?"selected":"" %>>英文</option>
					 <option value="L2" <%="L2".equals(eas_webservice_language)?"selected":"" %>>简体中文</option>
					 <option value="L3" <%="L3".equals(PropertyFile.readValue("firstframe.properties", "eas.webservice.language"))?"selected":"" %>>繁体中文</option>
				    </select>
				    
					</td>
					<td  align="left" style="word-break: break-all">
						简体中文
					</td>
					<td  align="left">
						EAS语言：英文、简体中文、繁体中文。该属性只在集成EAS时有效
					</td>
				</tr>
				
				<tr>
					<td  class=dataLabel align="right">
						EAS数据中心数据库类型：
					</td>
					<td  class=dataField align="left">
					<select id="eas_webservice_dbtype" name="eas_webservice_dbtype">
					 <option value="0" <%="0".equals(PropertyFile.readValue("firstframe.properties", "eas.webservice.dbtype"))?"selected":"" %>>SQLServer</option>
					 <option value="1" <%="1".equals(PropertyFile.readValue("firstframe.properties", "eas.webservice.dbtype"))?"selected":"" %>>DB2</option>
					 <option value="2" <%="2".equals(PropertyFile.readValue("firstframe.properties", "eas.webservice.dbtype"))?"selected":"" %>>Oracle</option>
				    </select>
					</td>
					<td  align="left" style="word-break: break-all">
						&nbsp;
					</td>
					<td  align="left">
						EAS数据中心数据库类型：SQLServer、DB2、Oracle。该属性只在集成EAS时有效
					</td>
				</tr>
				<tr>
					<td  class=dataLabel align="right">
						在EAS集成情况下是否冒泡消息
					</td>
					<td  class=dataField align="left">
				
				<input type="radio" name="message_eas_popup" value="yes"
								<%if("yes".equals(PropertyFile.readValue("firstframe.properties", "constant.message_eas_popup"))){%>checked="checked" <%}%>/>
							是
				<input type="radio" name=message_eas_popup value="no"
				                <%if("no".equals(PropertyFile.readValue("firstframe.properties", "constant.message_eas_popup"))){%>checked="checked" <%}%>/> 
							否			
					
					</td>
					<td  align="left" style="word-break: break-all">
						否
					</td>
					<td  align="left">
						是则冒泡显示，否则不显示，默认为否，这个与EAS参数连用
					</td>
				</tr>
				<tr>
					<td  class=dataLabel align="right">
						同步OA消息类型：
					</td>
					<td  class=dataField align="left">
					 <input type="text" size="40" name="message_eas_source" value="<%= message_eas_source %>">
					</td>
					<td  align="left" style="word-break: break-all">
						&nbsp;
					</td>
					<td  align="left">
						向EAS同步消息的类型，有些地方只想同步公文处理的消息，为空或者不配置则是全部，如果设置为0，则表示没有消息要同步，1,联系沟通/2,公文到达/3,公文催办/4,日程提醒/5,会议通知/6,会议提醒/7,邮件到达/8,文件传阅/9,图书催还/10,公文督办/11,新闻审核/12,知识中心/13,车辆审批/14,办公用品/15,通知公告/16,通知公告审核/17,公文流转完成
					</td>
				</tr>
				<tr><td colspan="4">
				EAS集成主要工作：<br>
                1、使用集成版本的EASOA安装，安装后已经将部分集成数据初始化了，使用EAS的管理控制台进行EASOA的部署<br>
			    2、修改同步的SQL，一般情况下不需要修改，特别情况例如：需要用户名加工号，或者同步繁体字段等，这些SQL写在<a href="../application/file_download.jsp?filePath=<%=(System.getProperty("oa_application.config")+"/easconfig.properties") %>&fileName=easconfig.properties">easconfig.properties</a><br>
			    3、EAS集成主要的设置在EAS系统中，EAS与OA安装在同一个机器上，从EAS5.4之后，安装后将不在修改EAS中的easWebConfig.xml和yiruan_oa.jsp文件，除非不是安装在同一台机器上，或者OA的端口发生了修改！<br>
			    4、EAS Portal的集成需要到数据中心上，向EAS数据库插入SQL可以实现<br>
				</td></tr>
			  </tbody>
			</table>
			
			
			
		</form>
		
		
			<script language="javascript">
			   //判断是否为eas集成
			  var easIntegration = <%=PropertyFile.readValue("firstframe.properties", "plugins.eas") %>;
			  var k3Integration = <%=PropertyFile.readValue("firstframe.properties", "constant.business") %>;
			  easIntegration =  easIntegration.toString();
			  k3Integration = k3Integration.toString();
			  function init(){
			    if(k3Integration=='true'){
			      document.getElementById("integrationK3").checked = true;
			    }else if(easIntegration=='true'){
			      document.getElementById("integrationEas").checked = true;
			    }else{
			      document.getElementById("integrationNo").checked = true;
			    }
			    chanageEasSettingShow(easIntegration);
			  }
              //根据值设置eas集成设置是否显示			  
			  function chanageEasSettingShow(isEasIntegration){
			    if(isEasIntegration=='true'){
			      document.getElementById("easIntegrationId").style.display='inline';   
			    }else{
			      document.getElementById("easIntegrationId").style.display='none';   
			    }
			  }
             
             //当系统集成选项被修改时，		
		     function integrationChanage(){
		       var integration = getRadioValue("integration");
		       if(integration == 'eas'){
		        easIntegration = 'true';
		       }else{
		         easIntegration = 'false';
		       }
		       chanageEasSettingShow(easIntegration);
		     }
			 init();
			</script>
		
	</body>
</html>
